<template>
    <div id="SearchResult">
        <div class="SearchResultHead">
            <span class="mui-icon mui-icon-back" @click="pushBack"></span>
            <i class="mui-icon mui-icon-search"></i>
            <input type="text" placeholder="商品名称、档口/..." />
            <span @click="show">搜索</span>
        </div>
        <div class="SearchResultContent">
            <ul>
                <li v-for="(item,key) in navlist" :key="key" @click.stop="pushView(item,key)">
                    {{item.name}}
                </li>
            </ul>
            <router-view></router-view>
        </div>
    </div>
</template>
<script>
export default {
  data() {
    return {
      listcontent: [],
      navlist: [
        { name: "综合", path: "/searchResult/zonghe" },
        { name: "销量", path: "/searchResult/xiaoliang" },
        { name: "价格", path: "/searchResult/jiage" }
      ]
    };
  },
  methods: {
    pushBack() {
      this.$router.push({ path: "/SearchView" });
    },
    pushView(item, key) {
      this.$router.push({ path: item.path });
    },
    show() {
      alert("功能暂时没有被开发");
    }
  }
};
</script>

<style lang="scss" scoped>
#SearchResult {
  position: absolute;
  width: 100%;
  height: 100%;
  background: green;
  z-index: 10000;
  .SearchResultHead {
    position: fixed;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    height: 60px;
    background: #c6091b;
    padding-bottom: 10px;
    span {
      flex: 2;
      text-align: center;
      line-height: 40px;
    }
    input {
      flex: 8;
      margin: 0;
      padding-left: 40px;
    }
    i {
      position: absolute;
      left: 16%;
      top: 30%;
    }
  }
  .SearchResultContent {
    width: 100%;
    height: 100%;
    margin-top: 60px;
    background: lightblue;
    ul {
      position: fixed;
      display: flex;
      flex-direction: row;
      justify-content: space-around;
      align-items: center;
      width: 100%;
      height: 40px;
      line-height: 40px;
      background: white;
      li {
        flex: 1;
        text-align: center;
        height: 30px;
        line-height: 30px;
      }
      li:nth-child(2) {
        border-left: 1px solid lightgray;
        border-right: 1px solid lightgray;
      }
    }
  }
}
</style>

